package net.tv90.volunteerserveradmin.dao;

import net.tv90.volunteerserveradmin.model.domain.GradeSubmission;
import net.tv90.volunteerserveradmin.model.domain.Image;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;
import java.util.Optional;

public interface GradeSubmissionRepository extends JpaRepository<GradeSubmission, Long>, JpaSpecificationExecutor<GradeSubmission> {

    // 根据项目ID查询所有评分记录
    List<GradeSubmission> findByProjectId(Long projectId);

    List<GradeSubmission> findByVolunteerIdAndProjectId(Long studentId, Long projectId);

    Optional<GradeSubmission> findByTeacherIdAndVolunteerIdAndProjectId(Long teacherId, Long studentId, Long projectId);
}
